/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package main

import (
	"github.com/rs/zerolog/log"
	"github.com/spf13/viper"
	"kvmc/cmd"
	_ "kvmc/init"
	"kvmc/pkg/util"
	"os"
)

func init() {
	if !util.IsFileExists(viper.GetString("sys.mainDir")) {
		err := os.MkdirAll(viper.GetString("sys.mainDir"), os.ModePerm)
		if err != nil {
			log.Err(err).Msg("create main dir failed")
			os.Exit(1)
		}
	}
}

func main() {
	cmd.Execute()
}
